package com.crm.services;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.crm.model.mdao.RepairrecordMapper;
import com.crm.model.mpojo.Repairrecord;


/**
 * 维修工单明细记录表
 * @author 梁箐
 *
 */
@Service
public class RepairrecordServices {
	
	@Autowired
	RepairrecordMapper repairrecordMapper;
	
	
	/**
	 * 查询单条
	 * @return 
	 */
	public List<Map<String, String>> selectByID(Integer id) {
		return repairrecordMapper.selectByRcID(id);
	}
	
	
	/**
	 * 添加记录
	 * @return 
	 */
	public int add(Repairrecord repairrecord) {
		return repairrecordMapper.insertSelective(repairrecord);
	}
	
	/**
	 * 添加记录
	 * @return 
	 */
	public int addJPA(Repairrecord repairrecord) {
		return repairrecordMapper.insertSelective(repairrecord);
	}
	
	/**
	 * 更新记录
	 * @return 
	 */
	public int update(Repairrecord repairrecord) {
		return repairrecordMapper.updateByPrimaryKeySelective(repairrecord);
	}
	
}
